package com.hbjycl.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;

/**
 * 角色
 * 
 * @author wxp
 *
 * @datetime 2014年8月20日下午4:19:32
 */
@Entity
public class Role extends BaseEntity
{
    private static final long serialVersionUID = 330236163276757786L;
    private String            name;                                  // 角色名称
    private String            value;                                 // 角色标识
    private Boolean           isSystem;                              // 是否为系统内置角色
    private String            description;                           // 描述
                                                                      
    private Set<Admin>        adminSet;                              // 管理员
                                                                      
    @Column(nullable = false, unique = true)
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    @Column(nullable = false, unique = true)
    public String getValue()
    {
        return value;
    }
    
    public void setValue(String value)
    {
        this.value = value;
    }
    
    @Column(nullable = false, updatable = false)
    public Boolean getIsSystem()
    {
        return isSystem;
    }
    
    public void setIsSystem(Boolean isSystem)
    {
        this.isSystem = isSystem;
    }
    
    @Column(length = 5000)
    public String getDescription()
    {
        return description;
    }
    
    public void setDescription(String description)
    {
        this.description = description;
    }
    
    @ManyToMany(fetch = FetchType.LAZY, mappedBy = "roleSet")
    public Set<Admin> getAdminSet()
    {
        return adminSet;
    }
    
    public void setAdminSet(Set<Admin> adminSet)
    {
        this.adminSet = adminSet;
    }
    
}
